package threading;

public class Demo13 {

    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(()-> {
            /*for (int i = 0; i < 100000000; i++) {


            }*/

            try {
                Thread.sleep(2000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        });

        //t 开始之前 得到的NEW
        System.out.println(t.getState());
        t.start();


        Thread.sleep(50);
        //t 正在工作 得到的RUNNABLE
        System.out.println(t.getState());
        t.join();

        //t 结束之后 得到的状态 TERMINATED
        System.out.println(t.getState());
    }
}
